resource "local_file" "ansible_inventory" {
  content    = templatefile("${path.module}/templates/hosts.tftpl", { vms = vsphere_virtual_machine.vms, user = var.user.name } )
  filename   = "${abspath(path.module)}/playbook/hosts.yaml"

  depends_on = [ vsphere_virtual_machine.vms ]
}